/*
 * server.cpp
 *
 *  Created on: 15/04/2012
 *      Author: david
 */

#include "TcpServer.h"
#include <cstring>
#include <stdio.h>

using namespace stk;

int main(){
	char * buffer = "a";
	TcpServer localhost(2006);
	//if no connection requests are pending and socket has not been set non-blocking
	//this function will block until a conection is present
	localhost.accept();
	
	//printf("enter the message\n");
	//fgets(buffer,255,stdin);
	//int wb = localhost.writeBuffer((const void *)buffer, 255, 0);
	int wb = localhost.writeBuffer((void*)buffer,sizeof(buffer), 0);
	
	std::cout<<wb<<std::endl;
	printf("fin server\n");
return 0;
}
